<script setup>
/**
 * BaseButton 组件
 * 统一全局主按钮样式，基于 Vant4 van-button 封装，适合移动端主操作场景。
 *
 * @props {string} type 按钮类型（primary/success/warning/danger等），默认 primary
 * @props {boolean} block 是否块级显示，默认 true
 * @props {boolean} round 是否圆角，默认 true
 * @props {boolean} loading 是否加载中，默认 false
 * @props {boolean} disabled 是否禁用，默认 false
 * @props {string} nativeType 原生 type 属性，默认 button
 *
 * @example
 * <BaseButton>主要操作</BaseButton>
 * <BaseButton type="success">成功按钮</BaseButton>
 * <BaseButton :loading="true">加载中</BaseButton>
 * <BaseButton :disabled="true">禁用按钮</BaseButton>
 */

defineProps({
  type: { type: String, default: 'primary' },
  block: { type: Boolean, default: true },
  round: { type: Boolean, default: true },
  loading: { type: Boolean, default: false },
  disabled: { type: Boolean, default: false },
  nativeType: { type: String, default: 'button' } // 支持 submit
})
</script>

<template>
  <van-button
    :type="type"
    :block="block"
    :round="round"
    :loading="loading"
    :disabled="disabled"
    :native-type="nativeType"
    class="base-main-btn w-full h-48px text-lg font-600 bg-gradient-to-r from-blue-500 to-blue-600 text-white border-none shadow-md transition-all duration-200"
    v-bind="$attrs"
  >
    <slot />
  </van-button>
</template>
